<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>02_JSON对象</title>
</head>
<body>
<!--
1. JSON.stringify(obj/arr)
  * js对象(数组)转换为json对象(数组)
2. JSON.parse(json)
  * json对象(数组)转换为js对象(数组)

-->
<script type="text/javascript">
  var o = {username: '999',age:"54"};
  o = JSON.stringify(o)
  console.log(o)
  o = JSON.parse(o);
  console.log(o)
</script>
</body>
</html>